const fs = require('fs');
class goodsController {
    async getGoodsById(req, res, next) {
        let id = req.query.id
        let listStr = fs.readFileSync("public/data/list.json").toString()     
        let result = JSON.parse(listStr).find(el=>el.id == id) 
        res.json(result)
    }


}
module.exports = new goodsController();//导出

